<template>
  <div class="dashboard-editor-container">
    <!-- <github-corner class="github-corner"  margin-top:12px;  /> -->

    <el-row style="width: 86.3%; top: 6px; z-index: 999; position: fixed">
      <el-col :span="6" class="card-box">
        <!-- <i class="el-icon-s-data" /><span style="font-weight:600;color:#666;margin-right: 450px;margin-left: 5px;">
          销售总览
        </span> -->
        <el-cascader
          class="region"
          v-model="value"
          placeholder="选择店铺分组"
          :options="cascadeList"
          :props="{ checkStrictly: true }"
          @change="handleChange"
          style="width: 250px; height: 30px"
        >
        </el-cascader>
      </el-col>
      <el-col :span="11" style="height: 30px">
        <nav id="navbar">
          <ul>
            <!-- <li :class="{ active: isActiveSection(1) }">
              <a href="#section1" @click="scrollToSection(1)">销售总览</a>
            </li>
            <li :class="{ active: isActiveSection(2) }">
              <a href="#section2" @click="scrollToSection(2)">渠道销售</a>
            </li>
            <li :class="{ active: isActiveSection(3) }">
              <a href="#section3" @click="scrollToSection(3)">店铺销售</a>
            </li>
            <li :class="{ active: isActiveSection(4) }">
              <a href="#section4" @click="scrollToSection(4)">品类排行</a>
            </li>
            <li :class="{ active: isActiveSection(5) }">
              <a href="#section5" @click="scrollToSection(5)">库存总览</a>
            </li>

            <li :class="{ active: isActiveSection(6) }">
              <a href="#section6" @click="scrollToSection(6)">渠道库存</a>
            </li>
            <li :class="{ active: isActiveSection(7) }">
              <a href="#section7" @click="scrollToSection(7)">店铺库存</a>
            </li>
            <li :class="{ active: isActiveSection(8) }">
              <a href="#section8" @click="scrollToSection(8)">地区排行</a>
            </li> -->
          </ul>
        </nav>
      </el-col>
      <el-col :span="7">
        <date
          v-model="valueTime"
          :type.sync="groupType"
          @handleChangeTime="handleChangeTime($event)"
        ></date>
      </el-col>
      <!-- <timeSearch @getDateArr="getDateArr" @changDay="changDay" :timeArr="timeArr" :dayActive="this.dayActive"
        :dayLimit="1095" /> -->
    </el-row>

    <section id="section1">
      <el-row style="background: #fff; margin-bottom: 16px">
        <el-card>
          <div
            slot="header"
            style="display: flex; justify-content: space-between"
          >
            <span><i class="el-icon-s-data"></i> 销售总览</span>
          </div>
          <panel-group :itemData="biNumberOfItem" />
        </el-card>
      </el-row>

      <el-card style="background: #fff; margin-bottom: 16px">
        <div slot="header">
          <span><i class="el-icon-s-data"></i> 销售渠道</span>
          <el-select
            v-model="liveType"
            placeholder="达播/自播"
            clearable
            @change="handleChange"
            style="width: 100px; margin-left: 10px"
          >
            <el-option
              v-for="dict in liveTypeList"
              :key="dict"
              :label="dict"
              :value="dict"
            />
          </el-select>
        </div>

        <el-row :gutter="10" style="margin-bottom: 16px; font-weight: bold">
          <el-col :span="6">
            <el-card>
              <div
                slot="header"
                style="display: flex; justify-content: space-between"
              >
                <span><i class="el-icon-collection"></i> 销售金额占比</span>
                <!-- <el-select
                v-model="liveType"
                placeholder="达播/自播"
                clearable
                @change="handleChange"
                style="width: 100px"
              >
                <el-option
                  v-for="dict in liveTypeList"
                  :key="dict"
                  :label="dict"
                  :value="dict"
                />
              </el-select> -->
              </div>
              <PieChart :id="'PieChart'" :chartData="PieChartData" />

              <!-- <el-row style="margin-top: 10px">
                <el-col
                  :span="12"
                  style="display: flex; justify-content: space-between"
                >
                  <span></span><span>销售{{ liveType }}金额：</span></el-col
                >
                <el-col :span="12">
                  {{
                    biNumberOfItem.payAmount
                      ? biNumberOfItem.payAmount
                      : "未更新"
                  }}</el-col
                >
              </el-row>
              <el-row style="margin-top: 10px">
                <el-col
                  :span="12"
                  style="display: flex; justify-content: space-between"
                >
                  <span></span><span>销售总金额：</span></el-col
                >
                <el-col :span="12">
                  {{
                    biNumberOfItem.totalPayAmount
                      ? biNumberOfItem.totalPayAmount
                      : "未更新"
                  }}</el-col
                >
              </el-row> -->
              <div class="el-table el-table--enable-row-hover el-table--medium">
                <table cellspacing="0" style="width: 100%">
                  <!-- <thead>
                      <tr>
                        <th class="el-table__cell is-leaf">
                          <div class="cell">类型</div>
                        </th>
                        <th class="el-table__cell is-leaf">
                          <div class="cell">销售金额</div>
                        </th>
                        <th class="el-table__cell is-leaf">
                          <div class="cell"></div>
                        </th>
                      </tr>
                    </thead> -->
                  <tbody>
                    <tr>
                      <td class="el-table__cell is-leaf" style="width: 50%">
                        <div class="cell" style="font-weight: bold">
                          销售{{ liveType }}金额
                        </div>
                      </td>
                      <td class="el-table__cell is-leaf" style="width: 50%">
                        <div class="cell" style="font-weight: bold">
                          {{
                            biNumberOfItem.payAmount
                              ? formatNumber(biNumberOfItem.payAmount)
                              : "未更新"
                          }}
                        </div>
                      </td>
                    </tr>
                    <tr>
                      <td class="el-table__cell is-leaf" style="width: 50%">
                        <div class="cell" style="font-weight: bold">
                          销售总金额
                        </div>
                      </td>
                      <td class="el-table__cell is-leaf" style="width: 50%">
                        <div class="cell" style="font-weight: bold">
                          {{
                            biNumberOfItem.totalPayAmount
                              ? formatNumber(biNumberOfItem.totalPayAmount)
                              : "未更新"
                          }}
                        </div>
                      </td>
                    </tr>
                  </tbody>
                </table>
              </div>
              <!-- <div
              style="
                text-align: center;
                margin-top: 140px;
                height: 200px;
                font-weight: bold;
                font-size: 18px;
              "
            >
              <el-row>
                <el-col :span="12">{{ liveType }}-销售金额占比：</el-col>
                <el-col :span="12">{{
                  biNumberOfItem.saleAmountRatio
                    ? biNumberOfItem.saleAmountRatio + "%"
                    : "未更新"
                }}</el-col>
              </el-row>
              <el-row style="margin-top: 10px">
                <el-col :span="12">销售金额：</el-col>
                <el-col :span="12">
                  {{
                    biNumberOfItem.payAmount
                      ? biNumberOfItem.payAmount
                      : "未更新"
                  }}</el-col
                >
              </el-row>
              <el-row style="margin-top: 10px">
                <el-col :span="12">销售总金额：</el-col>
                <el-col :span="12">
                  {{
                    biNumberOfItem.totalPayAmount
                      ? biNumberOfItem.totalPayAmount
                      : "未更新"
                  }}</el-col
                >
              </el-row>
            </div> -->
            </el-card>
          </el-col>
          <el-col :span="18">
            <el-card>
              <chartData :chart-data="echartData" />
            </el-card>
          </el-col>
        </el-row>
        <el-row :gutter="10" style="margin-bottom: 16px; font-weight: bold">
          <el-col :span="6">
            <el-card>
              <div
                slot="header"
                style="justify-content: space-between; display: flex"
              >
                <span><i class="el-icon-collection"></i> 成交订单占比</span>
              </div>
              <PieChart :id="'orderPieChar'" :chartData="orderPieChartData" />
              <!-- <el-row style="margin-top: 10px">
                <el-col
                  :span="12"
                  style="display: flex; justify-content: space-between"
                >
                  <span></span><span>销售{{ liveType }}订单数：</span></el-col
                >
                <el-col :span="12">{{
                  biNumberOfItem.orderQuantity
                    ? biNumberOfItem.orderQuantity
                    : "未更新"
                }}</el-col>
              </el-row>
              <el-row style="margin-top: 10px">
                <el-col
                  :span="12"
                  style="display: flex; justify-content: space-between"
                >
                  <span></span><span>销售总订单数：</span></el-col
                >
                <el-col :span="12">{{
                  biNumberOfItem.totalOrderQuantity
                    ? biNumberOfItem.totalOrderQuantity
                    : "未更新"
                }}</el-col>
              </el-row> -->
              <div class="el-table el-table--enable-row-hover el-table--medium">
                <table cellspacing="0" style="width: 100%">
                  <!-- <thead>
                      <tr>
                        <th class="el-table__cell is-leaf">
                          <div class="cell">类型</div>
                        </th>
                        <th class="el-table__cell is-leaf">
                          <div class="cell">销售金额</div>
                        </th>
                        <th class="el-table__cell is-leaf">
                          <div class="cell"></div>
                        </th>
                      </tr>
                    </thead> -->
                  <tbody>
                    <tr>
                      <td class="el-table__cell is-leaf" style="width: 50%">
                        <div class="cell">销售{{ liveType }}订单数</div>
                      </td>
                      <td class="el-table__cell is-leaf" style="width: 50%">
                        <div class="cell">
                          {{
                            biNumberOfItem.orderQuantity
                              ? noFixed(biNumberOfItem.orderQuantity)
                              : "未更新"
                          }}
                        </div>
                      </td>
                    </tr>
                    <tr>
                      <td class="el-table__cell is-leaf" style="width: 50%">
                        <div class="cell">销售总订单数</div>
                      </td>
                      <td class="el-table__cell is-leaf" style="width: 50%">
                        <div class="cell">
                          {{
                            biNumberOfItem.totalOrderQuantity
                              ? noFixed(biNumberOfItem.totalOrderQuantity)
                              : "未更新"
                          }}
                        </div>
                      </td>
                    </tr>
                  </tbody>
                </table>
              </div>
              <!-- <div
              style="
                text-align: center;
                margin-top: 150px;
                height: 250px;
                font-weight: bold;
                font-size: 18px;
              "
            >
              <el-row>
                <el-col :span="12"> {{ liveType }}-成交订单占比：</el-col>
                <el-col :span="12">{{
                  biNumberOfItem.orderQuantityRatio
                    ? biNumberOfItem.orderQuantityRatio + "%"
                    : "未更新"
                }}</el-col>
              </el-row>
              <el-row style="margin-top: 10px">
                <el-col :span="12">销售订单数：</el-col>
                <el-col :span="12">{{
                  biNumberOfItem.orderQuantity
                    ? biNumberOfItem.orderQuantity
                    : "未更新"
                }}</el-col>
              </el-row>
              <el-row style="margin-top: 10px">
                <el-col :span="12">销售总订单数：</el-col>
                <el-col :span="12">{{
                  biNumberOfItem.totalOrderQuantity
                    ? biNumberOfItem.totalOrderQuantity
                    : "未更新"
                }}</el-col>
              </el-row>
            </div> -->
            </el-card>
          </el-col>
          <el-col :span="18">
            <el-card>
              <chartData :chart-data="echartDataI" />
            </el-card>
          </el-col>
        </el-row>
        <el-row :gutter="10" style="font-weight: bold">
          <el-col :span="6">
            <el-card>
              <div
                slot="header"
                style="justify-content: space-between; display: flex"
              >
                <span><i class="el-icon-collection"></i> 退款金额占比</span>
              </div>
              <PieChart :id="'listPieChar'" :chartData="listPieChartData" />
              <!-- <el-row style="margin-top: 10px">
                <el-col
                  :span="12"
                  style="display: flex; justify-content: space-between"
                >
                  <span></span><span>退款{{ liveType }}金额：</span></el-col
                >
                <el-col :span="12">{{
                  biNumberOfItem.returnAmount
                    ? biNumberOfItem.returnAmount
                    : "未更新"
                }}</el-col>
              </el-row>
              <el-row style="margin-top: 10px">
                <el-col
                  :span="12"
                  style="display: flex; justify-content: space-between"
                >
                  <span></span><span>退款总金额：</span></el-col
                >
                <el-col :span="12">{{
                  biNumberOfItem.totalReturnAmount
                    ? biNumberOfItem.totalReturnAmount
                    : "未更新"
                }}</el-col>
              </el-row> -->
              <div class="el-table el-table--enable-row-hover el-table--medium">
                <table cellspacing="0" style="width: 100%">
                  <!-- <thead>
                      <tr>
                        <th class="el-table__cell is-leaf">
                          <div class="cell">类型</div>
                        </th>
                        <th class="el-table__cell is-leaf">
                          <div class="cell">销售金额</div>
                        </th>
                        <th class="el-table__cell is-leaf">
                          <div class="cell"></div>
                        </th>
                      </tr>
                    </thead> -->
                  <tbody>
                    <tr>
                      <td class="el-table__cell is-leaf" style="width: 50%">
                        <div class="cell">退款{{ liveType }}金额</div>
                      </td>
                      <td class="el-table__cell is-leaf" style="width: 50%">
                        <div class="cell">
                          {{
                            biNumberOfItem.returnAmount
                              ? formatNumber(biNumberOfItem.returnAmount)
                              : "未更新"
                          }}
                        </div>
                      </td>
                    </tr>
                    <tr>
                      <td class="el-table__cell is-leaf" style="width: 50%">
                        <div class="cell">退款总金额</div>
                      </td>
                      <td class="el-table__cell is-leaf" style="width: 50%">
                        <div class="cell">
                          {{
                            biNumberOfItem.totalReturnAmount
                              ? formatNumber(biNumberOfItem.totalReturnAmount)
                              : "未更新"
                          }}
                        </div>
                      </td>
                    </tr>
                  </tbody>
                </table>
              </div>
              <!-- <div
              style="
                text-align: center;
                margin-top: 150px;
                height: 250px;
                font-weight: bold;
                font-size: 18px;
              "
            >
              <el-row>
                <el-col :span="12">{{ liveType }}-退款金额占比：</el-col>
                <el-col :span="12">{{
                  biNumberOfItem.returnAmountRatio
                    ? biNumberOfItem.returnAmountRatio + "%"
                    : "未更新"
                }}</el-col>
              </el-row>
              
            </div> -->
            </el-card>
          </el-col>
          <el-col :span="18">
            <el-card>
              <chartData :chart-data="echartDataII" />
            </el-card>
          </el-col>
        </el-row>
      </el-card>
    </section>

    <section id="section2">
      <!-- -->
      <el-row :gutter="10">
        <el-card style="margin-bottom: 16px">
          <div
            slot="header"
            style="justify-content: space-between; display: flex"
          >
            <span><i class="el-icon-collection"></i> 达播分析</span>
            <span>
              <el-col :span="1.5">
                <el-button
                  type="warning"
                  plain
                  icon="el-icon-download"
                  size="mini"
                  @click="handleExport"
                  >导出</el-button
                >
              </el-col>
            </span>
          </div>
          <el-table
            :data="biNumberItem"
            :height="500"
            style="width: 100%"
            header-cell-class-name="table-header"
            row-class-name="table-row-low"
            border
            @cell-click="tableList"
            @sort-change="handleSortItem"
          >
            <el-table-column
              label="达人名称"
              align="center"
              prop="talentName"
              :show-overflow-tooltip="true"
            ></el-table-column>
            <el-table-column
              label="产品款号"
              align="center"
              prop="item"
            ></el-table-column>
            <el-table-column
              sortable
              label="销售总金额"
              align="center"
              prop="payAmount"
            />
            <el-table-column
              sortable
              label="款式对应消费频次"
              align="center"
              prop="orderQuantity"
            ></el-table-column>
            <el-table-column
              sortable
              label="销售总件数"
              align="center"
              prop="productQuantity"
            />
            <el-table-column
              sortable
              label="退款总金额"
              align="center"
              prop="returnAmount"
            />
            <el-table-column
              sortable
              label="净销售金额"
              align="center"
              prop="netSaleAmount"
            />
            <el-table-column
              sortable
              label="净销售件数"
              align="center"
              prop="netSaleQuantity"
            />
            <el-table-column
              sortable
              label="综合退款率"
              align="center"
              prop="returnRate"
            >
              <template slot-scope="scope">
                {{ scope.row.returnRateStr }}
              </template>
            </el-table-column>
            <el-table-column
              sortable
              label="折扣率"
              align="center"
              prop="discountRate"
            >
              <template slot-scope="scope">
                {{ scope.row.discountRateStr }}
              </template>
            </el-table-column>
          </el-table>
          <pagination
            v-show="objItemtotal > 0"
            :total="objItemtotal"
            :page.sync="objItem.pageNum"
            :limit.sync="objItem.pageSize"
            @pagination="getselectLiveOrderSaleList(objItem)"
          />
        </el-card>
      </el-row>
    </section>

    <section id="section2">
      <!-- -->
      <el-row :gutter="10" style="background: #fff; margin-bottom: 16px">
        <el-card>
          <div
            slot="header"
            style="justify-content: space-between; display: flex"
          >
            <span><i class="el-icon-collection"></i> 自播分析</span>
            <span>
              <el-col :span="1.5">
                <el-button
                  type="warning"
                  plain
                  icon="el-icon-download"
                  size="mini"
                  @click="handleExportSelf"
                  >导出</el-button
                >
              </el-col>
            </span>
          </div>
          <el-table
            :data="biNumberSelf"
            :height="500"
            highlight-current-row
            style="width: 100%"
            @cell-click="tableEdit"
            @sort-change="handleSortSelf"
            border
          >
            <!-- <el-table-column sortable
              label="达人名称"
              align="center"
              prop="talentName"
            ></el-table-column> -->
            <el-table-column
              label="产品款号"
              align="center"
              prop="item"
            ></el-table-column>
            <el-table-column
              sortable
              label="销售总金额"
              align="center"
              prop="payAmount"
            />
            <el-table-column
              sortable
              label="款式对应消费频次 "
              align="center"
              prop="orderQuantity"
            ></el-table-column>
            <el-table-column
              sortable
              label="销售总件数"
              align="center"
              prop="productQuantity"
            />
            <el-table-column
              sortable
              label="退款总金额"
              align="center"
              prop="returnAmount"
            />
            <el-table-column
              sortable
              label="净销售金额"
              align="center"
              prop="netSaleAmount"
            />
            <el-table-column
              sortable
              label="净销售件数"
              align="center"
              prop="netSaleQuantity"
            />
            <el-table-column
              sortable
              label="综合退款率"
              align="center"
              prop="returnRate"
            >
              <template slot-scope="scope">
                {{ scope.row.returnRateStr }}
              </template>
            </el-table-column>
            <el-table-column
              sortable
              label="折扣率"
              align="center"
              prop="discountRate"
            >
              <template slot-scope="scope">
                {{ scope.row.discountRateStr }}
              </template>
            </el-table-column>
          </el-table>
          <pagination
            v-show="objSelftotal > 0"
            :total="objSelftotal"
            :page.sync="objSelf.pageNum"
            :limit.sync="objSelf.pageSize"
            @pagination="getselectLiveOrderSaleList(objSelf)"
          />
        </el-card>
      </el-row>
    </section>

    <section>
      <el-row style="background: #fff; margin-bottom: 16px">
        <el-card>
          <div
            slot="header"
            style="display: flex; justify-content: space-between"
          >
            <span><i class="el-icon-s-data"></i> {{ typeLive }}</span>
          </div>
          <panel-group-i :itemData="itemData" />
        </el-card>
      </el-row>
    </section>

    <section id="section3">
      <!-- margin-bottom: 16px-->
      <el-row :gutter="10" style="margin-bottom: 16px">
        <el-col :span="12">
          <el-card>
            <chartData :chart-data="echartDataIII" />
          </el-card>
        </el-col>
        <el-col :span="12">
          <el-card>
            <chartData :chart-data="echartDataIV" />
          </el-card>
        </el-col>
      </el-row>
    </section>
  </div>
</template>

<script>
import {
  listBiLiveOrder,
  getBiLiveOrder,
  delBiLiveOrder,
  addBiLiveOrder,
  updateBiLiveOrder,
  selectLiveVoStatistics,
  selectLiveData,
  selectLiveOrderSaleList,
  selectLiveSaleStatistics,
} from "@/api/live/BiLiveOrder";
import { getCache } from "@/api/monitor/cache";
// import echarts from "echarts";
import * as echarts from "echarts/lib/echarts.js";
require("echarts/extension/bmap/bmap");
import "echarts/map/js/china.js"; //引入中国地图数据
import city from "echarts/map/json/china-cities.json";
import date from "./day/date.vue";
import chartDataI from "./components/chartDataI";
import chartDataII from "./components/chartDataII";
import chartDataIII from "./components/chartDataIII";
import chartDataIV from "./components/chartDataIV";
// import chartDataII from "./components/chartDataII";
import chartData from "./components/chartData";
import MixChart from "./Chart/MixChart.vue";
import timeSearch from "./day/day.vue";
import exhaustionDay from "./day/exhaustionDay.vue";

// import GithubCorner from '@/components/GithubCorner'
import PanelGroup from "./components/PanelGroup";
import PanelGroupI from "./components/PanelGroupI";
import PanelGroupII from "./components/PanelGroupII";
// import LineChart from './components/LineChart'
import chartDataRaddar from "./components/chartDataRaddar";
import RaddarChart from "./components/RaddarChart";
import PieChart from "./components/PieChart";
// import BarChart from './components/BarChart'
import { firstThreeScreenRank } from "@/api/sku/BiSkuSaleDwd";
import {
  numberOfItem,
  TopSaleProvince,
  synchroChannelData,
} from "@/api/chart/BiChannelSaleDwd";
import {
  selectChannelStatistics,
  selectSaleSingle,
  channelSaleTop,
  shopSaleTop,
  selectInventoryData,
  selectInvStatistics,
  getchannelInventoryTop,
  getshopInventoryTop,
  selectFirstStatistics,
  selectAllFirstThreeList,
} from "@/api/chart/SaleDwd";

import { listBrandChannelShop, listAll } from "@/api/chart/brandChannelShop";
// import PanelGroupI from "../../Warehouse/sale/components/PanelGroupI.vue";
import Card from "./Chart/card.vue";
import CountTo from "vue-count-to";
const lineChartData = {};

export default {
  name: "Admin",
  dicts: [
    "sys_product_item",
    "sys_product_secondary",
    "sys_product_cycle",
    "sys_product_pl",
  ],
  components: {
    chartDataRaddar,
    // GithubCorner,
    PanelGroup,
    PanelGroupI,
    PanelGroupII,
    // LineChart,

    // RaddarChart,
    PieChart,
    // BarChart,

    chartData,
    chartDataI,
    chartDataII,
    chartDataIII,
    chartDataIV,
    MixChart,
    // TransactionTable,
    // TodoList,
    // BoxCard
    timeSearch,
    exhaustionDay,
    date,
    PanelGroupI,
    Card,
    CountTo,
  },
  data() {
    return {
      typeLive: "款式成交明细",
      //饼图
      PieChartData: {
        // order: {
        xData: "",
        female: [],
      },
      orderPieChartData: {
        // order: {
        xData: "",
        female: [],
      },
      listPieChartData: {
        // order: {
        xData: "",
        female: [],
      },

      //watch用到的
      query: {},
      liveType: "自播",
      liveTypeList: ["自播", "达播"],
      dayActiveRate: 2,
      timeArrRate: [
        // { value: "1", label: "今天" },
        { value: "2", label: "售罄时间定义" },
        // { value: "7", label: "最近7天" },
        // { value: "30", label: "最近30天" },
      ],
      timeGapRate: { startSellOutDate: "", endSellOutDate: "" },
      //品类属性
      itemType: [
        { value: "salesAmount", label: "销售金额" },
        { value: "returnAmount", label: "退款金额" },
        // { value: "factory_order", label: "工厂订单" },
        // { value: "salesGrossProfit", label: "采购在途" },
        { value: "saleDays", label: "可售天数" },
        { value: "netSalesAmount", label: "净销售额" },
        { value: "totalSalesNumber", label: "总销售件数" },
        { value: "netSalesNumber", label: "净销售件数" },
        { value: "returnBeforeShipmentNumber", label: "发货前退货件数" },
        { value: "returnAfterShipmentNumber", label: "发货后退货件数" },
        { value: "totalReturnNumber", label: "总退货件数" },
        { value: "comprehensiveReturnRate", label: "综合退货率" },
        { value: "grossProfit", label: "毛利额" },
        { value: "grossProfitRate", label: "毛利率" },
        // { value: "endingInventory", label: "库存" },
        { value: "exhaustionRate", label: "售馨率" },
        { value: "sdNumber", label: "SD单件数" },
        { value: "mjxNumber", label: "MJX单件数" },
      ],
      //价格带
      list: [],
      //多选品类
      formData: {
        libraryIdList: [{ id: "" }],
      },
      libraryOptions: [
        // { value: "1", label: "库位1" },
        // { value: "2", label: "库位2" },
        // { value: "3", label: "库位3" },
        // { value: "4", label: "库位4" },
        // { value: "5", label: "库位5" },
        // { value: "6", label: "库位6" },
      ], // 库存名称列表

      //雷达图
      echartDataRaddar: [],
      //总览数据
      itemData: {},
      // 总条数
      total: 0,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        property: "salesAmount",
        firstLevelList: null,
        secondLevelList: null,
        threeLevelList: null,
      },
      //商品排行
      ItemDateList: [],
      //产品视角
      productView: "一级",
      //店铺SaleTop
      shopSaleTopList: [],
      //渠道SaleTop
      channelSaleTopList: [],
      //店铺库存Top
      shopInventoryTopList: [],
      //渠道库存Top
      channelInventoryTopList: [],
      // 统计店铺销售信息
      commandstats: null,
      //统计渠道销售信息
      usedmemory: null,
      // 统计店铺库存信息
      shoptotalStock: null,
      //统计渠道库存信息
      totalStock: null,
      //锚点
      sections: document.querySelectorAll("section"),
      activeSection: null,
      active: null,
      scrollTimer: null,
      //地区前20
      TopSallist: [],
      tableHeight: window.innerHeight - 175,
      pageHeight: window.innerHeight - 280,
      itemHeight: window.innerHeight - 680,
      shopListHeight: window.innerHeight - 570,
      //达播
      biNumberItem: [],
      objItem: {
        property: "payAmount",
        pageNum: 1,
        pageSize: 10,
      },
      objItemtotal: 0,
      //自播
      biNumberSelf: [],
      objSelf: {
        pageNum: 1,
        pageSize: 10,
      },
      objSelftotal: 0,

      //时间控件
      timeObj: {},
      //客单价
      biNumberOfItem: {},

      //时间控件
      valueTime: new Date(new Date().setDate(new Date().getDate() - 1)),
      groupType: "date",

      highlighted: ["销售金额", "退款金额", "净销售额"], // 初始化时，前两个元素高亮

      //传递数据
      echartData: {
        columns: ["支付日期", "达播销售金额", "自播销售金额"],
        rows: [],
      },
      //传递数据
      echartDataI: {
        columns: ["支付日期", "达播成交订单数", "自播成交订单数"],
        rows: [],
      },
      //传递数据
      echartDataII: {
        columns: ["支付日期", "达播退款金额", "自播退款金额"],
        rows: [],
      },
      //传递数据
      echartDataIII: {
        columns: ["支付日期", "成交订单数"],
        rows: [],
      },
      //传递数据
      echartDataIV: {
        columns: ["支付日期", "销售金额"],
        rows: [],
      },
      highlightedSku: ["库存总金额", "产品库存总金额", "配件库存总金额"], // 初始化时，前两个元素高亮

      //Sku传递数据
      echartDataSku: {
        columns: ["支付日期", "库存总金额", "产品库存总金额", "配件库存总金额"],
        rows: [],
      },
      //时间
      //
      dayActive: 365,
      timeArr: [
        { value: "2", label: "昨天" },
        { value: "7", label: "最近7天" },
        { value: "30", label: "日" },
        { value: "56", label: "周" },
        { value: "365", label: "月" },
        { value: "1", label: "自定义" },
      ],
      timeGap: { startTime: "", endTime: "" },
      // 店铺
      cascadeList: [],
      // , "天猫", "vfu运动旗舰店"
      value: [],
      loading: false,
      //店铺名称
      shopName: "",
      mapData: [],
      lineChartData: lineChartData.newVisitis,
    };
  },
  created() {
    this.getList();

    // this.handleChangeTime()
    /** 查询品牌渠道店铺关系列表 */
    this.getdataSourceList();
    // this.openLoading();
  },
  // mounted() {
  //   this.$store.dispatch("app/toggleSideBarHide", fa);
  // },
  watch: {
    productView: {
      handler: function (newnew, oldold) {
        console.log(JSON.stringify(newnew));
        this.list = [];
        this.formData = {
          libraryIdList: [{ id: "" }],
        };
        //  this.chinaConfigure();
        // this.chinaConfigure();
        // this.$nextTick(() => {
        //   this.$refs.platform.echarts.resize();
        // });
      },
      deep: true,
      immediate: true,
    },
    timeObj: {
      handler: function (newnew, oldold) {
        if (JSON.stringify(this.query) == "{}") {
          return;
        }
        let obj = {
          salesGrade: this.value,
          ...this.timeObj,
          ...this.query,
        };
        // selectLiveOrderSaleList(obj).then((response) => {
        //   this.itemData = response.rows ? response.rows[0] : {};
        // });
        this.itemData = {};
        // this.echartDataIII = {};
        // this.echartDataIV = {};
        this.typeLive = "款式成交明细";
        this.echartDataIII.rows = [];
        this.echartDataIV.rows = [];
        // this.getselectLiveSaleStatistics(obj);
      },
      deep: true,
      immediate: true,
    },
  },
  mounted() {
    window.addEventListener("scroll", this.startScrollTimer);
  },
  beforeDestroy() {
    window.removeEventListener("scroll", this.startScrollTimer);
  },

  methods: {
    formatNumber(number) {
      // 将数字保留两位小数，并转为字符串
      const numberStr = number.toFixed(2);

      // 分割整数部分和小数部分
      const [integerPart, decimalPart] = numberStr.split(".");

      // 将整数部分按千分位分隔
      const integerPartWithCommas = integerPart.replace(
        /\B(?=(\d{3})+(?!\d))/g,
        ","
      );

      // 拼接整数部分和小数部分
      return integerPartWithCommas + "." + (decimalPart || "00");
    },
    //切换大屏
    goto() {
      if (!this.biNumberItem[0].value) {
        this.$modal.msgError("你选择的日期无数据");
      } else {
        this.$router.push({
          path: "/example/datav",
        });
      }
    },
    changDayRate(val) {
      this.dayActiveRate = val;
      this.timeGapRate.startSellOutDate = val[0];
      this.timeGapRate.endSellOutDate = val[1];
    },
    getDateArrRate(value) {
      this.timeGapRate.startSellOutDate = value[0];
      this.timeGapRate.endSellOutDate = value[1];
      console.log(JSON.stringify(this.timeGapRate));
      this.changePage();
    },

    //匹配品类
    getselectKeyWordList(key) {
      selectAllFirstThreeList({
        inputValue: key,
        grade: this.productView,
      }).then((response) => {
        this.libraryOptions = response.sort((a, b) => a.length - b.length);
      });
    },
    //添加库存名称
    addLibraryIdList() {
      if (this.formData.libraryIdList.length > 4) {
        this.$modal.msgError("请选择不超过5个品类");
        return;
      }
      if (this.formData.libraryIdList.length > 0) {
        let hasValue = false;
        for (let i = 0; i < this.formData.libraryIdList.length; i++) {
          if (!this.formData.libraryIdList[i].id) {
            hasValue = true;
            break;
          }
        }
        if (hasValue) {
          return this.$message.warning("请先选择未选择项");
        }
        this.formData.libraryIdList.push({ id: "" });
      }
    },
    //库存名称删除
    delRow(item, index) {
      if (this.formData.libraryIdList.length > 1) {
        this.formData.libraryIdList.splice(index, 1);
        // this.$forceUpdate;
        const E = echarts.init(this.$refs.echarts);
        E.dispose();
      } else {
        this.$message.warning("至少选择一项");
      }
    },
    //匹配曲线指标
    get_item_name_by_en_name(en_name) {
      let res = "销售金额";

      let relation = {
        salesAmount: "销售金额",
        returnAmount: "退款金额",
        // "factory_order":
        salesGrossProfit: "采购在途",
        saleDays: "可售天数",

        netSalesAmount: "净销售额",
        totalSalesNumber: "总销售件数",
        netSalesNumber: "净销售件数",
        returnBeforeShipmentNumber: "发货前退货件数",
        returnAfterShipmentNumber: "发货后退货件数",
        totalReturnNumber: "总退货件数",
        comprehensiveReturnRate: "综合退货率",
        grossProfit: "毛利额",
        grossProfitRate: "毛利率",
        endingInventory: "库存",
        exhaustionRate: "售罄率",
        sdNumber: "SD单件数",
        mjxNumber: "MJX单件数",
      };

      if (relation.hasOwnProperty(en_name)) {
        res = relation[en_name];
      }

      return res;
    },

    keywordListlength(type) {
      // this.selectKeyWordStatisticsEchartsII();
      console.log(JSON.stringify(type));
      console.log(JSON.stringify(this.formData.libraryIdList));
      var m = [];
      this.formData.libraryIdList.forEach((item) => {
        m.push(item.id);
        // if (item.id == type) {
        //   this.$modal.msgError("你输入的品类重复，请重新输入");
        // }
      });
      let filteredArray = m.filter(function (item) {
        return item === type;
      });

      if (filteredArray.length > 1) {
        this.$modal.msgError("你输入的品类重复，请重新输入");
      }
    },
    //品类
    goodstableEdit(row, column, cell, event) {
      // console.log(JSON.stringify(column.property));
      if (
        column.property == "endingInventory" ||
        column.property == "salesGrossProfit"
      ) {
        return;
      }
      this.queryParams.property = column.property;
      if (event.ctrlKey) {
        //如果ctr1按下就让他按下的标识符变为true
        var m = [];
        this.formData.libraryIdList.forEach((item) => {
          if (item.id == "") {
            this.formData.libraryIdList.splice(0, 1);
          }
          m.push(item.id);
        });
        if (this.formData.libraryIdList.length > 4) {
          this.$modal.msgError("请选择不超过5个品类");
          return;
        }
        let filteredArray = m.filter(function (item) {
          // if (row.sourceName) {
          //   return item == row.sourceName;
          // } else {
          //   return item == row.label;
          // }
          return item == row.itemGrade;
        });

        if (filteredArray.length > 0) {
          this.$modal.msgError("你选择的品类重复，请重新选择");
          return;
        } else {
          this.formData.libraryIdList.push({ id: row.itemGrade });
        }
      }
      this.selectFirstStatisticsEchartsII();
    },
    //价格带
    pricetableEdit(row, column, cell, event) {
      //请求前初始化
      const Raddar = echarts.init(this.$refs.Raddar);
      // Raddar.dispose();
      // let list = [];
      let note = [];
      if (event.ctrlKey) {
        //如果ctr1按下就让他按下的标识符变为true
        var m = [];
        this.list.forEach((item) => {
          m.push(item.itemGrade);
        });
        let filteredArray = m.filter(function (item) {
          // if (row.sourceName) {
          //   return item == row.sourceName;
          // } else {
          //   return item == row.label;
          // }
          return item == row.itemGrade;
        });

        if (filteredArray.length > 0) {
          this.$modal.msgError("你选择的品类重复，请重新选择");
          return;
        } else {
          this.list.push(row);
        }
      }
      const keyArray = this.list.map((item) => item.itemGrade);

      this.list.forEach((item, index) => {
        note.push({
          name: item.itemGrade,
          type: "bar",
          // step: "start",
          data: [
            item.firstPriceRangeNum,
            item.secondPriceRangeNum,
            item.thirdPriceRangeNum,
            item.fourthPriceRangeNum,
            item.fifthPriceRangeNum,
            item.sixthPriceRangeNum,
            item.seventhPriceRangeNum,
            item.eighthPriceRangeNum,
            // `${person.firstPriceRangeNum}, ${person.secondPriceRangeNum},${person.thirdPriceRangeNum}, ${person.fourthPriceRangeNum},${person.fifthPriceRangeNum}, ${person.sixthPriceRangeNum},${person.seventhPriceRangeNum}, ${person.eighthPriceRangeNum}`,
          ],
        });
      });
      console.log(JSON.stringify(note));

      const option = {
        grid: {
          left: "0",
          top: "10%",
          right: "2%",
          bottom: "10%",
        },
        // 提示框
        tooltip: { trigger: "axis" },
        xAxis: {
          type: "category",
          data: [
            "100以下",
            "[100,150)",
            "[150,200)",
            "[200,250)",
            "[250,300)",
            "[300,350)",
            "[350,400)",
            "400以上",
          ],
        },
        yAxis: { type: "value" },
        legend: {
          data: keyArray,
        },
        series: note,
      };

      // this.echartData.order.xData = xData;
      // this.echartData.order.series = series;
      // const Raddar = echarts.init(this.$refs.Raddar);

      Raddar.setOption(option);
    },
    //多对一指标点击回传
    handleSetItemChartData(type) {
      console.log(JSON.stringify(type));

      this.queryParams.property = type;
      this.selectFirstStatisticsEchartsII();
    },
    //曲线分析
    selectFirstStatisticsEchartsII() {
      const E = echarts.init(this.$refs.echarts);
      E.dispose();
      if (!this.formData.libraryIdList[0].id) {
        // console.log(555555);
        // this.$modal.msgError("请选择品类");
        return;
      }
      // console.log(JSON.stringify(this.formData.libraryIdList));
      const input = [];
      this.formData.libraryIdList.forEach((item) => {
        input.push(item.id);
      });
      // this.queryParams.keyWords = input.join();
      let obj = {
        dataS: input.join(),
        itemType: this.productView,
        property: this.queryParams.property,
        salesGrade: this.value.join(","),
        ...this.timeObj,
      };

      selectFirstStatistics(obj).then((response) => {
        console.log(JSON.stringify(response));

        let order = { date: [], data: [] };
        order.date = response.map((item) => item.dataDateUnit);
        response.forEach((item) => {
          order.data.push(item.keywordProperty);
        });
        const xData = order.date;

        console.log(JSON.stringify(order.data));
        const keyArray = Object.keys(order.data[0]);
        const series = [];
        keyArray.forEach((key) => {
          series.push({
            name: key,
            data: order.data.map((item) => item[key]),
            type: "line",
          });
        });

        const option = {
          grid: {
            left: "5%",
            top: "10%",
            right: "2%",
            bottom: "10%",
          },
          // 提示框
          tooltip: { trigger: "axis" },
          xAxis: {
            data: xData,
          },
          yAxis: {},
          legend: {
            data: keyArray,
          },
          series,
        };

        // this.echartData.order.xData = xData;
        // this.echartData.order.series = series;

        const E = echarts.init(this.$refs.echarts);

        E.setOption(option);
      });
    },
    //锚点
    scrollToSection(index) {
      const target = this.sections[index];
      // console.log(JSON.stringify(index));
      //     return
      this.active = index;
      if (target) {
        this.$nextTick(() => {
          target.scrollIntoView({ behavior: "smooth" });
          this.activeSection = target;
        });
      }
    },
    //锚点
    startScrollTimer() {
      this.scrollTimer = setInterval(() => {
        const currentSection = document.querySelector("section[data-active]");
        if (currentSection !== this.activeSection) {
          this.activeSection = currentSection;
        } else {
          clearInterval(this.scrollTimer);
        }
      }, 100); // 每100毫秒检查一次滚动位置是否变化
    },
    //锚点高亮
    isActiveSection(sectionId) {
      // 检查当前导航项是否处于高亮状态
      return this.active === sectionId;
    },

    //客件数
    getnumberOfItem(param) {
      numberOfItem(param).then((response) => {
        this.biNumberOfItem = response.biNumberOfItem;
        console.log(response);
      });
    },

    get_chinese_name_by_en_name(en_name) {
      let res = "总库存";
      let relation = {
        totalStockAmount: "库存总金额",
        productStockAmount: "产品库存总金额",

        accessoriesStockAmount: "配件库存总金额",
        totalStock: "总库存",
        productStock: "产品库存",
        accessoriesStock: "配件库存",
        totalStockRotationRate: "库存周转率",
        productStockRotationRate: "产品库存周转率",
        accessoriesStockRotationRate: "配件库存周转率",
        // grossProfit: "毛利额",
        // grossProfitRate: "毛利率",
        // endingInventory: "期末库存",
        // exhaustionRate: "售罄率",
        // sdNumber: "SD单件数",
        // mjxNumber: "MJX单件数",
      };

      if (relation.hasOwnProperty(en_name)) {
        res = relation[en_name];
      }

      return res;
    },
    shopInventorytableEdit(row, column, cell, event) {
      if (!column) {
        // column.property = column[3].property;
        return;
      }
      //饼图
      let list = [];

      this.shopInventoryTopList.forEach((item) => {
        console.log(JSON.stringify([column.property]));
        list.push({
          name: item.shop,
          // value: item.totalStock,
          value: item[column.property],
        });
      });

      this.shoptotalStock = echarts.init(this.$refs.shoptotalStock, "macarons");
      this.shoptotalStock.setOption({
        tooltip: {
          trigger: "item",
          formatter: "{a} <br/>{b} : {c} ({d}%)",
        },
        legend: {
          left: "center",
          bottom: "10",
          data: [this.get_chinese_name_by_en_name(column.property)],
        },
        series: [
          {
            name: this.get_chinese_name_by_en_name(column.property),
            type: "pie",
            // roseType: "radius",
            radius: [15, 95],
            center: ["50%", "38%"],
            data: list,
            animationEasing: "cubicInOut",
            animationDuration: 1000,
          },
        ],
      });
    },
    //店铺库存Top
    shopInventoryTop(obj) {
      getshopInventoryTop(obj).then((response) => {
        // console.log(JSON.stringify(response));
        if (response) {
          this.shopInventoryTopList = response ? response : [];

          //饼图
          let list = [];

          response.forEach((item) => {
            list.push({
              name: item.shop,
              value: item.totalStock,
            });
          });

          this.shoptotalStock = echarts.init(
            this.$refs.shoptotalStock,
            "macarons"
          );
          this.shoptotalStock.setOption({
            tooltip: {
              trigger: "item",
              formatter: "{a} <br/>{b} : {c} ({d}%)",
            },
            legend: {
              left: "center",
              bottom: "10",
              data: ["总库存"],
            },
            series: [
              {
                name: "总库存",
                type: "pie",
                // roseType: "radius",
                radius: [15, 95],
                center: ["50%", "38%"],
                data: list,
                animationEasing: "cubicInOut",
                animationDuration: 1000,
                //百分比
                label: {
                  normal: {
                    show: true,
                    formatter: "{b}({d}%)", //自定义显示格式(b:name, c:value, d:百分比)
                  },
                },
              },
            ],
          });
        }
      });
    },
    //渠道库存比例图
    channelInventorytableEdit(row, column, cell, event) {
      if (!column) {
        // column.property = column[3].property;
        return;
      }
      //饼图
      let list = [];

      this.channelInventoryTopList.forEach((item) => {
        console.log(JSON.stringify([column.property]));
        list.push({
          name: item.channel,
          // value: item.totalStock,
          value: item[column.property],
        });
      });

      this.totalStock = echarts.init(this.$refs.totalStock, "macarons");
      this.totalStock.setOption({
        tooltip: {
          trigger: "item",
          formatter: "{a} <br/>{b} : {c} ({d}%)",
        },
        legend: {
          left: "center",
          bottom: "10",
          data: [this.get_chinese_name_by_en_name(column.property)],
        },
        series: [
          {
            name: this.get_chinese_name_by_en_name(column.property),
            type: "pie",
            // roseType: "radius",
            radius: [15, 95],
            center: ["50%", "38%"],
            data: list,
            animationEasing: "cubicInOut",
            animationDuration: 1000,
          },
        ],
      });
    },
    //渠道库存Top
    channelInventoryTop(obj) {
      getchannelInventoryTop(obj).then((response) => {
        // console.log(JSON.stringify(response));
        if (response) {
          this.channelInventoryTopList = response ? response : [];
          // return;

          //饼图
          let list = [];
          response.forEach((item) => {
            list.push({
              name: item.channel,
              value: item.totalStock,
            });
          });

          this.totalStock = echarts.init(this.$refs.totalStock, "macarons");
          this.totalStock.setOption({
            tooltip: {
              trigger: "item",
              formatter: "{a} <br/>{b} : {c} ({d}%)",
            },
            legend: {
              left: "center",
              bottom: "10",
              data: ["总库存"],
            },

            series: [
              {
                name: "总库存",
                type: "pie",
                // roseType: "radius",
                radius: [15, 95],
                center: ["50%", "38%"],
                data: list,
                animationEasing: "cubicInOut",
                animationDuration: 1000,
                //百分比
                label: {
                  normal: {
                    show: true,
                    formatter: "{b}({d}%)", //自定义显示格式(b:name, c:value, d:百分比)
                  },
                },
              },
            ],
          });
        }
      });
    },
    //渠道SaleTop
    getchannelSaleTop(obj) {
      channelSaleTop(obj).then((response) => {
        // console.log(JSON.stringify(response));
        if (response) {
          this.channelSaleTopList = response ? response : [];

          //饼图
          let list = [];
          response.forEach((item) => {
            list.push({
              name:
                item.channel + "(" + (item.amountRatio * 100).toFixed(2) + "%)",
              value: item.salesAmount,
            });
          });

          this.$modal.closeLoading();

          this.usedmemory = echarts.init(this.$refs.usedmemory, "macarons");
          this.usedmemory.setOption({
            tooltip: {
              trigger: "item",
              // ({d}%)
              formatter: "{a} <br/>{b} : {c} ",
            },
            series: [
              {
                name: "销售金额",
                type: "pie",
                // roseType: "radius",
                radius: [15, 95],
                center: ["50%", "38%"],
                data: list,
                animationEasing: "cubicInOut",
                animationDuration: 1000,
              },
            ],
          });
        }
      });
    },

    //店铺SaleTop
    getshopSaleTop(obj) {
      shopSaleTop(obj).then((response) => {
        // console.log(JSON.stringify(response));
        if (response) {
          this.shopSaleTopList = response ? response : [];

          //饼图
          let list = [];
          response.forEach((item) => {
            list.push({
              name:
                item.shop + "(" + (item.amountRatio * 100).toFixed(2) + "%)",
              value: item.salesAmount,
            });
          });

          this.$modal.closeLoading();

          this.commandstats = echarts.init(this.$refs.commandstats, "macarons");
          this.commandstats.setOption({
            tooltip: {
              trigger: "item",
              // ({d}%)
              formatter: "{a} <br/>{b} : {c} ",
            },
            series: [
              {
                name: "销售金额",
                type: "pie",
                // roseType: "radius",

                radius: [15, 95],
                center: ["50%", "38%"],
                data: list,
                animationEasing: "cubicInOut",
                animationDuration: 1000,
              },
            ],
          });
        }
      });
    },

    //库存指标
    getselectSkuSingle(obj) {
      selectInventoryData(obj).then((response) => {
        // console.log(1111111);
        if (response) {
          this.biNumberSku = response;
          console.log(JSON.stringify(this.biNumberSku));
        }
      });
    },

    //库存曲线
    getechartSkuData(obj) {
      selectInvStatistics(obj).then((response) => {
        var row = [];
        response.forEach((item) => {
          row.push({
            支付日期: item.stockDate,
            产品库存: item.productStock,
            配件库存: item.accessoriesStock,
            总库存: item.totalStock,
            产品库存总金额: item.productStockAmount,
            配件库存总金额: item.accessoriesStockAmount,
            库存总金额: item.totalStockAmount,
            产品库存周转率: item.productStockRotationRate,
            配件库存周转率: item.accessoriesStockRotationRate,
            库存周转率: item.totalStockRotationRate,
            // 订单数量: item.totalOrdersNumber,
            // 商品销售件数: item.totalSoldNumber,
            // 销售毛利: item.salesGrossProfit,
            // 连带率: item.jointSeveralRate,
          });
        });
        // console.log(JSON.stringify(response));

        this.echartDataSku.rows = row;

        // this.echartData.rows = row
      });
    },

    //曲线
    getechartChannelData(obj) {
      selectChannelStatistics(obj).then((response) => {
        var row = [];
        response.forEach((item) => {
          row.push({
            支付日期: item.payDateUnit,
            销售金额: item.salesAmount,
            退款金额: item.returnAmount,
            净销售额: item.netSalesAmount,
            综合退货率: item.comprehensiveReturnRate * 0.01,
            发货前退货率: item.returnBeforeShipmentRate * 0.01,
            发货后退货率: item.returnAfterShipmentRate * 0.01,
            订单数量: item.totalOrdersNumber,
            商品销售件数: item.totalSoldNumber,
            销售毛利: item.salesGrossProfit,
            连带率: item.jointSeveralRate * 0.01,
            客单价: item.customerUnitPrice,
            货单价: item.unitPrice,

            商品货单价: item.unitPriceGoods,
            配件货单价: item.accessoriesUnitPrice,
            商品均售成本: item.averageCostSales,
            平均销售毛利率: item.averageSalesGrossProfit * 0.01,
            商品平均折扣率: item.averageDiscountRateGoods * 0.01,

            赠品配件数: item.complimentaryAccessoriesNumber,
            配件销售数量: item.salesAccessoriesNumber,

            配件成本比率: item.accessoriesCostRate,
            配件耗量比率: item.accessoriesConsumptionRate,

            // "总销售件数": item.totalSalesNumber,
            // "发货前退货件数": item.returnBeforeShipmentNumber,
          });
        });
        // console.log(JSON.stringify(response));

        this.echartData.rows = row;

        // this.echartData.rows = row
      });
    },
    //指标点击回传
    handleSetLineSkuData(type) {
      // console.log(JSON.stringify(type));
      if (this.highlightedSku.includes(type)) {
        return;
      }
      // 移除旧的高亮元素
      this.highlightedSku.shift();
      // // 添加新的高亮元素
      this.highlightedSku.push(type);

      console.log(JSON.stringify(this.highlightedSku));
      var arr = ["支付日期"];
      // let temp = arr.concat(this.highlightedSku);
      // // let temp = arr.push(type)
      // console.log(JSON.stringify(temp));
      // this.echartDataSku.columns = temp;
      let array = arr.concat(this.highlightedSku);
      // let temp = arr.push(type)
      // console.log(JSON.stringify(temp));
      // var array = ["支付日期", "退款金额", "净销售额", "毛利率"];
      var rateItem;

      // 遍历数组，找到包含'率'字的元素
      for (var i = 0; i < array.length; i++) {
        if (array[i].includes("率")) {
          rateItem = array[i];
          break;
        }
      }

      // 如果找到了包含'率'字的元素，将其移到数组最后
      if (rateItem) {
        var index = array.indexOf(rateItem);
        if (index !== array.length - 1) {
          array.splice(index, 1);
          array.push(rateItem);
        }
      }

      console.log(array);
      this.echartDataSku.columns = array;
    },
    //指标点击回传
    handleSetLineChartData(type) {
      // console.log(JSON.stringify(type));
      if (this.highlighted.includes(type)) {
        return;
      }
      // 移除旧的高亮元素
      this.highlighted.shift();
      // // 添加新的高亮元素
      this.highlighted.push(type);

      console.log(JSON.stringify(this.highlighted));
      var arr = ["支付日期"];
      let array = arr.concat(this.highlighted);
      // let temp = arr.push(type)
      // console.log(JSON.stringify(temp));
      // var array = ["支付日期", "退款金额", "净销售额", "毛利率"];
      var rateItem;

      // 遍历数组，找到包含'率'字的元素
      for (var i = 0; i < array.length; i++) {
        if (array[i].includes("率")) {
          rateItem = array[i];
          break;
        }
      }

      // 如果找到了包含'率'字的元素，将其移到数组最后
      if (rateItem) {
        var index = array.indexOf(rateItem);
        if (index !== array.length - 1) {
          array.splice(index, 1);
          array.push(rateItem);
        }
      }

      console.log(array);
      this.echartData.columns = array;
    },
    //店铺控件
    handleChange(val) {
      console.log(JSON.stringify(val));

      // var lastElement = val.pop();
      // this.shopName = lastElement

      // console.log(this.dayActive);
      let obj = { salesGrade: this.value, ...this.timeObj };
      console.log(JSON.stringify(obj));
      this.objItem = {
        isAsc: "false",
        property: "payAmount",
        liveType: "达播",
        salesGrade: this.value,
        ...this.timeObj,
        pageNum: this.objItem.pageNum,
        pageSize: this.objItem.pageSize,
      };
      this.objSelf = {
        isAsc: "false",
        property: "payAmount",
        liveType: "自播",
        salesGrade: this.value,
        ...this.timeObj,
        pageNum: this.objSelf.pageNum,
        pageSize: this.objSelf.pageSize,
      };
      localStorage.removeItem("result");
      // localStorage.setItem("result", JSON.stringify(obj));

      if (!obj.endTime) {
        return;
      }
      // else if (obj.dateType == "date" || obj.dateType == "daterange") {
      //   //销售指标
      //   this.getselectSaleSingle(obj);
      //   this.getselectLiveVoStatistics(obj);
      //   return;
      //   // console.log("库存接口");
      //   //渠道库存Top
      //   this.channelInventoryTop(obj);
      //   //店铺库存Top
      //   this.shopInventoryTop(obj);
      //   //曲线
      //   this.getechartChannelData(obj);

      //   //渠道SaleTop
      //   this.getchannelSaleTop(obj);
      //   //店铺SaleTop
      //   this.getshopSaleTop(obj);
      //   //sku曲线
      //   this.getechartSkuData(obj);
      //   //sku指标
      //   this.getselectSkuSingle(obj);
      //   //商品排行Top
      //   this.changeView();
      // }
      else {
        if (this.liveType == "综合") {
          //销售指标
          this.getselectSaleSingle(obj);
        } else if (this.liveType == "自播") {
          this.getselectSaleSingle(this.objSelf);
        } else if (this.liveType == "达播") {
          this.getselectSaleSingle(this.objItem);
        }
        this.getselectLiveVoStatistics(obj);
        //达播
        this.getselectLiveOrderSaleList(this.objItem);
        //自播
        this.getselectLiveOrderSaleList(this.objSelf);
        this.itemData = {};
        // this.echartDataIII = {};
        // this.echartDataIV = {};
        this.typeLive = "款式成交明细";
      }
    },
    handleSortItem(column) {
      /**
  排序方向 asc 升序 desc 降序
 
private String orderDirection;*/
      switch (column.order) {
        case "ascending":
          this.objItem.isAsc = "true";
          break;
        case "descending":
          this.objItem.isAsc = "false";
          break;
        default:
          this.objItem.isAsc = null;
          break;
      }
      this.objItem.property = column.prop; //查询字段是表格中字段名字
      // this.queryParams.orderDirection = column.order;//动态取值排序顺序

      this.getselectLiveOrderSaleList(this.objItem);
    },
    handleSortSelf(column) {
      /**
  排序方向 asc 升序 desc 降序
 
private String orderDirection;*/
      switch (column.order) {
        case "ascending":
          this.objSelf.isAsc = "true";
          break;
        case "descending":
          this.objSelf.isAsc = "false";
          break;
        default:
          this.objSelf.isAsc = null;
          break;
      }
      this.objSelf.property = column.prop; //查询字段是表格中字段名字
      // this.queryParams.orderDirection = column.order;//动态取值排序顺序

      this.getselectLiveOrderSaleList(this.objSelf);
    },
    //选完时间后发请求
    handleChangeTime(timeObj) {
      // console.log(type)
      // console.log(timeObj)
      // TODO
      this.timeObj = timeObj;
      this.itemData = {};
      // this.echartDataIII = {};
      // this.echartDataIV = {};
      this.typeLive = "款式成交明细";
      let param = {
        dataSource: this.value,
        startTime: this.dateFormat(timeObj.startTime),
        endTime: this.dateFormat(timeObj.endTime),
        dataType: this.groupType,
      };
      console.log(JSON.stringify(param));
      // if (!param.endTime) {
      //   return;
      // } else {
      //   // this.getechartChannelData(obj)
      //   //客件数
      //   this.getnumberOfItem(param);
      //   //地区Top20
      //   this.getTopSal(param);
      // }
      if (this.cascadeList.length < 1) {
        return;
      }
      console.log(JSON.stringify(this.timeObj));
      let obj = { salesGrade: this.value, ...timeObj };
      this.objItem = {
        isAsc: "false",
        property: "payAmount",
        liveType: "达播",
        salesGrade: this.value,
        ...timeObj,
        pageNum: this.objItem.pageNum,
        pageSize: this.objItem.pageSize,
      };
      this.objSelf = {
        isAsc: "false",
        property: "payAmount",
        liveType: "自播",
        salesGrade: this.value,
        ...timeObj,
        pageNum: this.objSelf.pageNum,
        pageSize: this.objSelf.pageSize,
      };

      console.log(JSON.stringify(obj));

      localStorage.removeItem("result");
      // localStorage.setItem("result", JSON.stringify(obj));

      if (!obj.endTime) {
        return;
      }
      // else if (obj.dateType == "date" || obj.dateType == "daterange") {
      //   //销售指标
      //   this.getselectSaleSingle(obj);
      //   this.getselectLiveVoStatistics(obj);
      //   return;
      //   // console.log("库存接口");
      //   //渠道库存Top
      //   this.channelInventoryTop(obj);
      //   //店铺库存Top
      //   this.shopInventoryTop(obj);
      //   //曲线
      //   this.getechartChannelData(obj);
      //   //销售指标
      //   this.getselectSaleSingle(obj);
      //   //渠道SaleTop
      //   this.getchannelSaleTop(obj);
      //   //店铺SaleTop
      //   this.getshopSaleTop(obj);
      //   //sku曲线
      //   this.getechartSkuData(obj);
      //   //sku指标
      //   this.getselectSkuSingle(obj);
      //   //商品排行Top
      //   this.changeView();
      // }
      else {
        if (this.liveType == "综合") {
          //销售指标
          this.getselectSaleSingle(obj);
        } else if (this.liveType == "自播") {
          this.getselectSaleSingle(this.objSelf);
        } else if (this.liveType == "达播") {
          this.getselectSaleSingle(this.objItem);
        }

        this.getselectLiveVoStatistics(obj);
        //达播
        this.getselectLiveOrderSaleList(this.objItem);
        //自播
        this.getselectLiveOrderSaleList(this.objSelf);

        return;
        //渠道库存Top
        this.channelInventoryTop(obj);
        //店铺库存Top
        this.shopInventoryTop(obj);
        //曲线
        this.getechartChannelData(obj);
        //销售指标
        this.getselectSaleSingle(obj);
        //渠道SaleTop
        this.getchannelSaleTop(obj);
        //店铺SaleTop
        this.getshopSaleTop(obj);
        //商品排行Top
        this.changeView();
      }
    },
    //达播
    tableList(row, column, cell, event) {
      this.query = { liveType: "达播", item: row.item };
      this.objItem.item = row.item;
      this.itemData = row;
      this.getselectLiveSaleStatistics(this.objItem);
      this.$message.warning("你已选择了数据，请往下拉到底部查看");
      this.typeLive = row.talentName + " 达人销售-款式成交明细";
    },
    //自播
    tableEdit(row, column, cell, event) {
      this.query = { liveType: "自播", item: row.item };
      this.objSelf.item = row.item;
      this.itemData = row;
      this.getselectLiveSaleStatistics(this.objSelf);
      this.$message.warning("你已选择了数据，请往下拉到底部查看");
      this.typeLive = this.value + " 自播销售-款式成交明细";
    },
    getselectLiveSaleStatistics(obj) {
      selectLiveSaleStatistics(obj).then((response) => {
        if (response) {
          // this.itemData = response;
          var row = [];
          var rowI = [];
          // var rowII = [];
          response.forEach((item) => {
            row.push({
              支付日期: item.dataDateUnit,
              成交订单数: item.orderQuantity,
              // 自播销售金额: item.payAmount,
            });
            rowI.push({
              支付日期: item.dataDateUnit,
              销售金额: item.payAmount,
              // 自播成交订单数: item.orderQuantity,
            });
            // rowII.push({
            //   支付日期: item.dataDateUnit,
            //   达播退款金额: item.talentReturnAmount,
            //   自播退款金额: item.returnAmount,
            // });
          });
          this.echartDataIII.rows = row;
          this.echartDataIV.rows = rowI;
          // this.echartDataII.rows = rowII;
        }
      });
    },
    //表格
    getselectLiveOrderSaleList(obj) {
      delete obj.item;
      selectLiveOrderSaleList(obj).then((response) => {
        if (obj.liveType == "达播") {
          this.biNumberItem = response.rows;
          this.objItemtotal = response.total;
        } else if (obj.liveType == "自播") {
          this.biNumberSelf = response.rows;
          this.objSelftotal = response.total;
        }
      });
    },
    /**
     * 合并行 - 书架
     */
    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
      // const { timetableBookVO } = this.detailData;
      const timetableBookVO = this.biNumberItem;
      const listMap = {};
      timetableBookVO.length &&
        timetableBookVO.forEach((item, index) => {
          if (listMap[item.talentName]) {
            // len - 用于书架合并多少行
            listMap[item.talentName].len += 1;
            // firstIndex - 用于同一个书架，最开始的书架进行合并，例如书架1，有3本书，则第一本书的书架1合并3行，后面都为0即可
            listMap[item.talentName].firstIndex =
              listMap[item.talentName].firstIndex < index
                ? listMap[item.talentName].firstIndex
                : index;
          } else {
            listMap[item.talentName] = { len: 1, firstIndex: index };
          }
        });
      if (columnIndex == 0) {
        if (
          listMap[row.talentName] &&
          listMap[row.talentName].firstIndex == rowIndex
        ) {
          return { rowspan: listMap[row.talentName].len, colspan: 1 };
        } else {
          return { rowspan: 0, colspan: 0 };
        }
      }
    },
    //销售指标
    getselectSaleSingle(obj) {
      var otherString = "";
      if (obj.liveType == "达播") {
        otherString = "自播";
      } else {
        otherString = "达播";
      }
      // delete obj.property;
      // delete obj.isAsc;
      // delete obj.pageNum;
      // delete obj.pageSize;
      selectLiveData(obj).then((response) => {
        // if (response) {
        this.biNumberOfItem = response ? response : {};
        console.log(JSON.stringify(this.biNumberOfItem));
        // if (response) {
        let row = [];
        row.push({
          value: response.payAmount,
          name: obj.liveType + "销售金额",
        });
        row.push({
          value: (response.totalPayAmount - response.payAmount).toFixed(0),
          name: otherString + "销售金额",
        });
        // this.PieChartData.xData = ["自然流量", "付费流量"];
        this.PieChartData.female = row;
        this.PieChartData.xData = response.saleAmountRatio;

        let order = [];
        order.push({
          value: response.orderQuantity,
          name: obj.liveType + "销售订单数",
        });
        order.push({
          value: (response.totalOrderQuantity - response.orderQuantity).toFixed(
            0
          ),
          name: otherString + "销售订单数",
        });
        // this.PieChartData.xData = ["自然流量", "付费流量"];
        this.orderPieChartData.female = order;
        this.orderPieChartData.xData = response.orderQuantityRatio;

        let list = [];
        list.push({
          value: response.returnAmount,
          name: obj.liveType + "退款金额",
        });
        list.push({
          value: (response.totalReturnAmount - response.returnAmount).toFixed(
            0
          ),
          name: otherString + "退款金额",
        });
        // this.PieChartData.xData = ["自然流量", "付费流量"];
        this.listPieChartData.female = list;
        this.listPieChartData.xData = response.returnAmountRatio;
        // }
        // }
      });
    },
    //销售趋势图
    getselectLiveVoStatistics(obj) {
      selectLiveVoStatistics(obj).then((response) => {
        // console.log(JSON.stringify(response));
        if (response) {
          // this.itemData = response;
          var row = [];
          var rowI = [];
          var rowII = [];
          response.forEach((item) => {
            row.push({
              支付日期: item.dataDateUnit,
              达播销售金额: item.talentPayAmount,
              自播销售金额: item.payAmount,
            });
            rowI.push({
              支付日期: item.dataDateUnit,
              达播成交订单数: item.talentOrderQuantity,
              自播成交订单数: item.orderQuantity,
            });
            rowII.push({
              支付日期: item.dataDateUnit,
              达播退款金额: item.talentReturnAmount,
              自播退款金额: item.returnAmount,
            });
          });
          this.echartData.rows = row;
          this.echartDataI.rows = rowI;
          this.echartDataII.rows = rowII;
        }
      });
    },
    //分页
    //售罄时间定义
    changePage() {
      //请求数据
      let obj = {
        salesGrade: this.value.join(","),
        ...this.timeObj,
        itemType: this.productView,
        dataType: this.groupType,
        ...this.queryParams,
        ...this.timeGapRate,
      };
      firstThreeScreenRank(obj).then((response) => {
        this.ItemDateList = response.rows;
        this.total = response.total;
      });
    },
    //视图角度
    changeView(val) {
      //请求前初始化
      // const Raddar = echarts.init(this.$refs.Raddar);
      // Raddar.dispose();
      this.queryParams.firstLevelList = null;
      this.queryParams.secondLevelList = null;
      this.queryParams.threeLevelList = null;
      this.formData = {
        libraryIdList: [{ id: "" }],
      };
      //请求数据
      let obj = {
        salesGrade: this.value.join(","),
        ...this.timeObj,
        itemType: this.productView,
        dataType: this.groupType,
        ...this.queryParams,
        ...this.timeGapRate,
      };
      firstThreeScreenRank(obj).then((response) => {
        this.ItemDateList = response.rows;
        this.total = response.total;

        // || this.productView == "三级"
        if (response.total == 0) {
          const E = echarts.init(this.$refs.echarts);
          E.dispose();
        } else {
          // this.radarData.rows = response.rows.slice(0, 2);
          let note = [];
          const keyArray = response.rows.map((item) => item.itemGrade);

          response.rows.forEach((item, index) => {
            if (index > 2) {
              return;
            }
            //多对一
            this.formData.libraryIdList.forEach((person) => {
              if (person.id == "") {
                this.formData.libraryIdList.splice(0, 1);
              }
              // m.push(item.id);
            });
            this.formData.libraryIdList.push({ id: item.itemGrade });

            //
            note.push({
              name: item.itemGrade,
              type: "bar",
              // step: "start",
              data: [
                item.firstPriceRangeNum,
                item.secondPriceRangeNum,
                item.thirdPriceRangeNum,
                item.fourthPriceRangeNum,
                item.fifthPriceRangeNum,
                item.sixthPriceRangeNum,
                item.seventhPriceRangeNum,
                item.eighthPriceRangeNum,
                // `${person.firstPriceRangeNum}, ${person.secondPriceRangeNum},${person.thirdPriceRangeNum}, ${person.fourthPriceRangeNum},${person.fifthPriceRangeNum}, ${person.sixthPriceRangeNum},${person.seventhPriceRangeNum}, ${person.eighthPriceRangeNum}`,
              ],
              // date: item.itemGrade,
              // firstPriceRangeNum: item.firstPriceRangeNum,
              // secondPriceRangeNum: item.secondPriceRangeNum,
              // thirdPriceRangeNum: item.thirdPriceRangeNum,
              // fourthPriceRangeNum: item.fourthPriceRangeNum,
              // fifthPriceRangeNum: item.fifthPriceRangeNum,
              // sixthPriceRangeNum: item.sixthPriceRangeNum,
              // seventhPriceRangeNum: item.seventhPriceRangeNum,
              // eighthPriceRangeNum: item.eighthPriceRangeNum,
            });
          });
          console.log(JSON.stringify(note));

          const option = {
            grid: {
              left: "5%",
              top: "10%",
              right: "3%",
              bottom: "10%",
            },
            // 提示框
            tooltip: { trigger: "axis" },
            xAxis: {
              type: "category",
              data: [
                "100以下",
                "[100,150)",
                "[150,200)",
                "[200,250)",
                "[250,300)",
                "[300,350)",
                "[350,400)",
                "400以上",
              ],
            },
            yAxis: { type: "value" },
            legend: {
              data: keyArray,
            },
            series: note,
          };

          // this.echartData.order.xData = xData;
          // this.echartData.order.series = series;
          const Raddar = echarts.init(this.$refs.Raddar);

          Raddar.setOption(option);
        }
        this.selectFirstStatisticsEchartsII();

        // console.log(JSON.stringify(this.ItemDateList));
      });
    },

    // 时间格式转换
    dateFormat(date) {
      date = new Date(date);
      let Y = date.getFullYear() + "-";
      let M =
        (date.getMonth() + 1 < 10
          ? "0" + (date.getMonth() + 1)
          : date.getMonth() + 1) + "-";
      let D = date.getDate() < 10 ? "0" + date.getDate() : date.getDate() + "";
      return Y + M + D;
    },
    /** 查询品牌渠道店铺关系列表 */
    getdataSourceList() {
      listAll().then((response) => {
        // response.rows = [
        //     { channel: '抖音', shopName: 'VFU抖一抖店-抖音', brand: 'VFU' },
        //     { channel: '抖音', shopName: 'VFU-抖音小店', brand: 'VFU' },
        //     { channel: '头条放心购', shopName: 'VFU-头条放心购', brand: 'VFU' },
        //     { channel: '拼多多', shopName: 'VFU-拼多多', brand: 'VFU' },
        //     { channel: '微信', shopName: 'VFU-微店', brand: 'VFU' },
        //     { channel: '微信', shopName: 'VFU-微信商城', brand: 'VFU' },
        //     { channel: '小红书', shopName: 'VFU-小红书', brand: 'VFU' },
        //     { channel: '严选', shopName: 'VFU-严寻合作', brand: 'VFU' },
        //     { channel: '天猫', shopName: 'VFU运动旗舰店', brand: 'VFU' },
        //     { channel: '京东', shopName: 'VFU运动旗舰店-京东', brand: 'VFU' }
        // ];
        // const result = [];
        let list = [];
        response.forEach((item) => {
          if (item.isTalentLive == "是") {
            list.push(item);
          }
        });
        let result = this.transformData(list);
        this.value = [result[0].label];
        // result[0].children[0].label,
        //   result[0].children[0].children[0].label,
        this.cascadeList = result;
        this.handleChange();
      });
    },
    //店铺渠道品牌转换

    transformData(data) {
      let result = [];

      data.forEach((item) => {
        let brand = item.brand;
        let channel = item.channel;
        let shopName = item.channelShopName;

        // 如果brand在结果数组中不存在，则创建一个新的数组
        let brandIndex = result.findIndex(
          (brandObj) => brandObj.label === brand
        );
        if (brandIndex === -1) {
          result.push({
            label: brand,
            value: brand,
            children: [],
          });
          brandIndex = result.length - 1;
        }

        // 如果channel在当前brand的children数组中不存在，则创建一个新的数组
        let channelIndex = result[brandIndex].children.findIndex(
          (channelObj) => channelObj.label === channel
        );
        if (channelIndex === -1) {
          result[brandIndex].children.push({
            label: channel,
            value: channel,
            children: [],
          });
          channelIndex = result[brandIndex].children.length - 1;
        }

        // 如果shopName在当前channel的children数组中不存在，则创建一个新的数组
        let shopIndex = result[brandIndex].children[
          channelIndex
        ].children.findIndex((shopObj) => shopObj.label === shopName);
        if (shopIndex === -1) {
          result[brandIndex].children[channelIndex].children.push({
            label: shopName,
            value: shopName,
            // children: []
          });
        }
      });

      return result;
    },
    /** 导出按钮操作 */
    handleExportSelf() {
      delete this.objSelf.item;
      this.download(
        "live/BiLiveOrder/liveOrderSaleExport",
        {
          ...this.objSelf,
        },
        `自播分析_${new Date().getTime()}.xlsx`
      );
    },
    handleExport() {
      delete this.objItem.item;
      this.download(
        "live/BiLiveOrder/liveOrderSaleExport",
        {
          ...this.objItem,
        },
        `达播分析_${new Date().getTime()}.xlsx`
      );
    },
    /** 查缓存询信息 */
    getList() {},
    // 打开加载层
    openLoading() {
      this.$modal.loading("正在加载分析销售监控数据，请稍候！");
    },
  },
};
</script>

<style lang="scss" scoped>
/* 移除默认的列表样式 */
ul {
  margin-top: 0.4%;
  list-style-type: none;
  /* 设置弹性布局，使列表项横向排列 */
  display: flex;
  /* 添加一些内边距和背景颜色 */
  // padding: 10px;
  margin-right: 10px;
  /* 设置边框和圆角 */
  // border: 1px solid #ddd;
  border-radius: 5px;
  flex-direction: row;
  align-items: center;
  justify-content: space-around;
}

/* 设置列表项样式 */
li {
  /* 添加一些内边距和右边距 */
  // padding: 10px;
  margin-right: 10px;
  /* 设置链接文本样式 */
  font-size: 15px;
  color: #bbb;
  text-decoration: none;
}

li.active a {
  // color: #f00;
  /* 高亮颜色 */
  color: #fff;
  background-color: #40c9c6;
}

// section {
//   margin-top: 60px;
// }

.dashboard-editor-container {
  padding: 16px;
  // background-color: rgb(240, 242, 245);
  position: relative;

  .github-corner {
    position: absolute;
    top: 0px;
    border: 0;
    right: 0;
  }

  .chart-wrapper {
    background: #fff;
    padding: 16px 16px 0;
    margin-bottom: 16px;
  }
}

@media (max-width: 1024px) {
  .chart-wrapper {
    padding: 8px;
  }
}
</style>
<style>
.el-scrollbar__wrap {
  /* overflow-x: hidden; */
  /* overflow-y: hidden; */
}
</style>
Excel(name =“达人名称")
private string talentName;
/** item */
@Excel(name =“产品款号")private String item;
/** 支付金额 */
@Excel(name =“支付金额")private Double payAmount;
/** 成交订单数 */@Excel(name =“成交订单数")
private Integer orderQvantity:
/** 销售件数 */
@Excel(name =“销售件数")
private Integer productQuantity;
/** 退款金额 */
@Excel(name =“退款金额")
private Double returnAmount;
销售总金额


销售订单数


销售总件数


退款总金额


净销售金额


净销售件
/** 净销售额 */
@Excel(name =“净销售额")private Double netSaleAmount;
/** 净销售件数 */@Excel(name ="净销售件数")private Integer netSaleQuantity;
/** 折扣率 */
@Excel(name =“折扣率")private Double discountRate;